package com.motong.gongdan.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.motong.gongdan.vo.customEvent.SearchVo;
import com.motong.gongdan.vo.system.CustomEvent.MissionEventMsg;
import com.motong.gongdan.vo.system.CustomEvent.WorkOrderEventMsg;
import com.motong.gongdan.vo.system.CustomEvent.WorkReportEventMsg;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * @author:fff
 * @time:2022/5/16
 */
@EqualsAndHashCode(callSuper = true)
@Data
@TableName("custom_event")
public class CustomEvent extends PublicPo{
    @TableId(value = "id",type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty("自定义事件名称")
    private String name;

    @ApiModelProperty("所属模块(0 工单, 1 任务,2 报工)")
    private Integer type;

    @ApiModelProperty("事件触发类型(0 数据变更, 1 定时触发)")
    @TableField("custom_type")
    private Integer customType;

    @ApiModelProperty("触发为数据变更时的操作, 0 新增，1 编辑， 2 删除")
    @TableField("custom_data_type")
    private Integer customDataType;

    @ApiModelProperty("触发事件条件")
    @TableField("data_condition")
    private String dataCondition;

    @ApiModelProperty("定时触发时触发时间")
    private Date time;

    @ApiModelProperty("重复方式 0/1/2/3/4/  执行一次/每天执行/每周同一天执行/每月同一天执行/每年同一天/")
    @TableField("time_type")
    private Integer timeType;

    @ApiModelProperty("定时触发时查询条件")
    @TableField("search_condition")
    private String searchCondition;

    @ApiModelProperty("统计数据")
    @TableField("statistics_data")
    private String statisticsData;

    @ApiModelProperty("后续操作类型 0/1 消息推送/数据变更")
    @TableField("event_type")
    private Integer eventType;

    @ApiModelProperty("执行对象")
    @TableField("push_object")
    private Integer pushObject;

    @ApiModelProperty("推送对象")
    @TableField("user_id")
    private String userId;

    @ApiModelProperty("推送部门")
    @TableField("dep_id")
    private String depId;

    @ApiModelProperty("推送信息")
    @TableField("push_mess")
    private String pushMess;

    @ApiModelProperty("状态(0 正常,1 停止)")
    private Integer state;

    @ApiModelProperty("eventType为1时执行表单类型 0/1 工单/任务")
    @TableField("execute_form")
    private Integer executeForm;

    @ApiModelProperty("执行事件 0 编辑数据")
    @TableField("execute_event")
    private Integer executeEvent;

    @ApiModelProperty("过滤条件 0/1/2 执行表单为1任务时表示上一个任务/下一个任务/本道任务 执行表单为0工单时0表示本工单")
    @TableField("filter_condition")
    private Integer filterCondition;

    @ApiModelProperty("执行动作 0/1 执行表单为0工单时表示开始工单/结束工单 执行表单为1任务时表示开始任务/结束任务")
    @TableField("execute_action")
    private Integer executeAction;

    @TableField(exist = false)
    private WorkOrderEventMsg pushMessVo;

    @TableField(exist = false)
    private MissionEventMsg MissionPushMessVo;

    @TableField(exist = false)
    private WorkReportEventMsg workReportPushMessVo;

    @TableField(exist = false)
    private String eventContent;

    @TableField(exist = false)
    @ApiModelProperty("查询条件")
    private List<SearchVo> searchVo;

    @TableField(exist = false)
    private Map<String,Object> statisticsDataMap;

    @ApiModelProperty("推送对象名称")
    @TableField(exist = false)
    private String userNames;

    @ApiModelProperty("推送部门名称")
    @TableField(exist = false)
    private String depNames;

}
